<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/common/includes.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="zzzzzz" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>zzzzzz - Sign up</title>
	<%@ include file="/WEB-INF/common/meta.jsp" %>
	<%@ include file="/WEB-INF/common/global_style.jsp" %>
	<%@ include file="/WEB-INF/common/global_script.jsp" %>
	<script type="text/javascript" src="${ctx}/res/js/signup_classic.js" ></script>
</head>
<body>

<%@ include file="/WEB-INF/common/header.jsp" %>

<div class="wrapper-content">
	<div class="signup-wrap wrap">
		<div class="main-content">
			<h1>Join us now.</h1>
			<ul class="horizontal">
				<li>
					<div class="wrapper-form">
						<form:form id="signup_form" action="${ctx}/signup" modelAttribute="signupForm" method="post" class="signup">
							<form:errors path="*" element="div" cssClass="msg-error"/>
							<div class="fieldset">
								<label for="signup_email" class="pbs clearfix">Email<span id="signup_email_error_msg" class="error rfloat" style="display: none;"></span></label>
								<form:input path="email" id="signup_email" tabindex="1" maxlength="64" data-explaination-text="What's your email address?" />
							</div>
							<div class="fieldset">
								<label for="signup_username" class="pbs clearfix">Username<span id="signup_username_error_msg" class="error rfloat" style="display: none;"></span></label>
								<form:input path="username" id="signup_username" tabindex="2" maxlength="20" data-explaination-text="Choose a unique username, at least 3 characters" />
							</div>
							<div class="fieldset">
								<label for="signup_password" class="pbs clearfix">Password<span id="signup_password_error_msg" class="error rfloat" style="display: none;"></span></label>
								<form:password path="password" id="signup_password" tabindex="3" maxlength="20" data-explaination-text="At least 6 characters" />
							</div>
							<div class="fieldset">
								<div class="clearfix">
									<div class="ui-overflow-hidden terms-of-service">
										<div style="height:32px;" class="ui-inline-block ui-inline-block-middle"></div><div class="ui-inline-block ui-inline-block-middle">
											<input type="checkbox" id="signup_terms_of_service" name="signup-terms-of-service" tabindex="4" value="" /><label for="signup_terms_of_service">I accept the <a target="_blank" href="${ctx}/terms_of_service">terms of service</a></label>
										</div>
									</div>
									<div class="rfloat">
										<span id="signup_submit_status" class="submit-status mrm mbs"><img src="${ctx}/res/images/common/spinner.gif" /></span><input type="submit" name="signup-submit" id="signup_submit" tabindex="5" class="btn style2 large" value="Sign up" />
									</div>
								</div>
								<div id="signup_tos_error_bubble" class="tos-error-bubble tos-error-bor1" style="display: none;"><b class="tos-error-bor2"><b class="tos-error-bor-bg"></b></b><label for="signup_terms_of_service"><span class="error">Must be accepted</span></label></div>
							</div>
						</form:form>
						<span id="signup_tip_bubble" style="display: none;" class="signup-tip-bubble"><b><b class="triangle-border-bg"></b></b><span id="signup_tip"></span></span>
					</div>
				</li>
				<li>
					<div class="social-connect">
						<ul class="social-index horizontal">
	          				<li><a href="${ctx}/users/auth/facebook" class="btn fb-connect large">Sign up with Facebook</a></li>
	        			</ul>
	        		</div>
				</li>
			</ul>
		</div>
	</div>
</div>

<script type="text/javascript">

jq(document).ready(function() {
	
	var signupClassic = new SignupClassic({
		'j_signup_tip_bubble' : jq("#signup_tip_bubble"),
		'j_signup_tip' : jq("#signup_tip"),
		'j_signup_form' : jq("#signup_form"),
		'j_signup_email' : jq("#signup_email"),
		'j_signup_username' : jq("#signup_username"),
		'j_signup_password' : jq("#signup_password"),
		'j_signup_terms_of_service' : jq("#signup_terms_of_service"),
		'j_signup_email_error_msg' : jq("#signup_email_error_msg"),
		'j_signup_username_error_msg' : jq("#signup_username_error_msg"),
		'j_signup_password_error_msg' : jq("#signup_password_error_msg"),
		'j_signup_tos_error_bubble' : jq("#signup_tos_error_bubble"),
		'j_signup_submit' : jq("#signup_submit"),
		'j_signup_submit_status' : jq("#signup_submit_status"),
		'_email_check_url' : "${ctx}/users/is_email_existing"
	});
	
});

</script>

<%@ include file="/WEB-INF/common/footer.jsp" %>

</body>
</html>